package com.itheima.user.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.user.mapper.AddressMapper;
import com.itheima.user.pojo.Address;
import com.itheima.user.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AddressServiceImpl extends ServiceImpl<AddressMapper, Address> implements AddressService {

    @Autowired
    private AddressMapper addressMapper;

    @Override
    public List<Address> findByUsername(String username) {
        List<Address> list = this.addressMapper.selectList(new QueryWrapper<Address>().eq("user_id", username));

        return list;
    }
}
